From 526c76181ece9c6ca966431bd07d46b003d500b4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timm=20B=C3=A4der?= Date: Mon, 21 Dec 2020 14:13:48 +0100 Subject: [PATCH] gl renderer: Check for pointer equality in rounded_rect_equal --- gsk/gl/gskglrenderops.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/gsk/gl/gskglrenderops.c b/gsk/gl/gskglrenderops.c index d7639162ad..8bd420e7bd 100644 --- a/gsk/gl/gskglrenderops.c +++ b/gsk/gl/gskglrenderops.c @@ -14,27 +14,28 @@ rect_equal (const graphene_rect_t *a, return memcmp (a, b, sizeof (graphene_rect_t)) == 0; } -static inline gboolean G_GNUC_PURE +static inline bool G_GNUC_PURE rounded_rect_equal (const GskRoundedRect *r1, const GskRoundedRect *r2) { - int i; + if (r1 == r2) + return true; if (!r1) - return FALSE; + return false; if (r1->bounds.origin.x != r2->bounds.origin.x || r1->bounds.origin.y != r2->bounds.origin.y || r1->bounds.size.width != r2->bounds.size.width || r1->bounds.size.height != r2->bounds.size.height) - return FALSE; + return false; - for (i = 0; i < 4; i ++) + for (int i = 0; i < 4; i ++) if (r1->corner[i].width != r2->corner[i].width || r1->corner[i].height != r2->corner[i].height) - return FALSE; + return false; - return TRUE; + return true; } static inline gboolean G_GNUC_PURE -- 2.30.2